home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue53 / Clinic / TheDLLUnit.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1999-12-03  |  472 b   |  30 lines

  1. unit TheDLLUnit;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows;
  7.  
  8. function DoSomething(Value: Integer): Bool; stdcall;
  9.  
  10. implementation
  11.  
  12. uses
  13.   Dialogs, ErrorMsgs;
  14.  
  15. function DoSomething(Value: Integer): Bool;
  16. begin
  17.   Result := False;
  18.   if Value < 0 then
  19.     SetLastError(ERROR_NUMBER_NEGATIVE)
  20.   else if Value > 1000 then
  21.     SetLastError(ERROR_NUMBER_TOO_BIG)
  22.   else
  23.   begin
  24.     Result := True;
  25.     ShowMessageFmt('Value passed was %d', [Value])
  26.   end
  27. end;
  28.  
  29. end.
  30.